<?php
$dbhost = '47.110.131.55';
$dbuser = 'root';
$dbpwd  ='sxy7788123456';
$dbName ='race';

$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
$filename='t.txt';
if (!file_exists($filename)){
    $daAn=array();
    $sql="select * from ti ";
    $query=$mysqli->query($sql);
    while ($list=$query->fetch_assoc()){
        $daAn[$list['id']]=array('d'=>$list['dan'],'s'=>$list['step']);
    }
    file_put_contents($filename, json_encode($daAn));
}else{
    $daAn=json_decode(file_get_contents($filename),true);
}
 

